package kechengsheji;

import javax.swing.*;
import java.awt.*;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class firstFrame extends JFrame {
    Font font = new Font("微软雅黑",Font.BOLD,20);

    public firstFrame() throws IOException {

        setLayout(null);
        setSize(600,600);
        setDefaultCloseOperation(2);
        setLocationRelativeTo(null);

        JTextArea jTextArea = new JTextArea();
        jTextArea.setLineWrap(true);
        jTextArea.setFont(font);
        jTextArea.setEditable(false);

        FileReader fin = new FileReader("src/kechengsheji/建筑信息/1号楼.txt");
        BufferedReader bin = new BufferedReader(fin);
        String aline;
        do{
            aline = bin.readLine();
            if(aline!=null) jTextArea.append(aline+"\n");
        }
        while (aline!=null);
        bin.close();
        fin.close();

        JScrollPane jScrollPane = new JScrollPane(jTextArea);
        jScrollPane.setBounds(0,0,584,555);
        jScrollPane.setVerticalScrollBarPolicy(22);
        add(jScrollPane);

        repaint();

    }

    //初始化
    void init(){

        setVisible(true);

    }
}

